package io.github.harmonly.service.impl;

import io.github.harmonly.entity.Finance;
import io.github.harmonly.mapper.FinanceMapper;
import io.github.harmonly.service.FinanceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FinanceServiceImpl implements FinanceService {

    @Resource
    private FinanceMapper mapper;

    @Override
    public List<Finance> getFinances() {
        return mapper.getFinances();
    }

    @Override
    public List<Finance> getFinancesByAid(int aid) {
        return mapper.getFinancesByAid(aid);
    }

    @Override
    public Finance getFinance(int fid) {
        return mapper.getFinance(fid);
    }

    @Override
    public boolean addFinance(Finance finance) {
        return mapper.addFinance(finance) == 1;
    }

    @Override
    public boolean deleteFinance(int fid) {
        return mapper.deleteFinance(fid) == 1;
    }

    @Override
    public boolean editFinance(Finance finance) {
        return mapper.editFinance(finance) == 1;
    }
}
